
function Button(){

    const handleClick = () => {
        console.log("OUCH!")
    }

    const handleClick2 = (name) => {
        console.log(`${name},stop clicking me!`)
    }

    let count = 0

    const handleClick3 = (name) => {
        if(count < 3){
            count++
            console.log(`${name},you clicked me ${count} times!`)
        }else{
            console.log("stop clicking me!")
        }
    }

    //
    const handleClick4 = (e)=>{ 
        e.target.textContent = "OUCH! 🥲"
    }

    return (
        // <button onClick={()=>handleClick3("Alan")}>
        //     Click me 🤣
        // </button>

        // 事件本身
        <button onDoubleClick={(e)=>handleClick4(e)}>
            Click me 🤣
        </button>
    )
}

export default Button